/*
 * All right reserved@Raygo 2022~2030
 */

package com.raygo.runner.core.command;

/**
 * 命令参数
 *
 * @author Raygo
 * @since 2022年8月6日
 */
public class CmdParam<T> {
    /**
     * 名称
     */
    private String name;
    /**
     * 描述
     */
    private String description;
    /**
     * 值
     */
    private T value;
    /**
     * 默认值
     */
    private String defaultValue;
    /**
     * 选择值
     */
    private String[] option;

    /**
     * 构造
     *
     * @param name  名称
     * @param value 值
     */
    public CmdParam(String name, T value) {
        this.name = name;
        this.value = value;
    }

    /**
     * 构造
     *
     * @param name  名称
     * @param value 值
     * @param desc  描述
     */
    public CmdParam(String name, T value, String desc) {
        this.name = name;
        this.value = value;
        this.description = desc;
    }

    /**
     * Get name value
     *
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * Get description value
     *
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * Set description to description
     *
     * @param description the description to set
     * @return this
     */
    public CmdParam<T> setDescription(String description) {
        this.description = description;
        return this;
    }

    /**
     * Get value value
     *
     * @return the value
     */
    public T getValue() {
        return value;
    }

    /**
     * Get defaultValue value
     *
     * @return the defaultValue
     */
    public String getDefaultValue() {
        return defaultValue;
    }

    /**
     * Set defaultValue to defaultValue
     *
     * @param defaultValue the defaultValue to set
     * @return this
     */
    public CmdParam<T> setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
        return this;
    }

    /**
     * Get option value
     *
     * @return the option
     */
    public String[] getOption() {
        return option;
    }

    /**
     * Set option to option
     *
     * @param option the option to set
     * @return this
     */
    public CmdParam<T> setOption(String... option) {
        this.option = option;
        return this;
    }
}
